<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>FillArea</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">FillArea()</font></b></p>
<p><b>语法</b></p><blockquote>
<font color="#3A3966"><b>FillArea</b></font>(x, y, BorderColor [, Color])</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Fill an arbitrary area starting from x,y position until the 
BorderColor is encountered. This is useful for filling any kind of shape. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>x, y</i></td>
<td width="90%"> 
 
The location at which the filling should start. 

 

</td></tr>
<tr><td><i>BorderColor</i></td>
<td> 
 
The color which should be considered the border to stop the filling. 
If this parameter is set to -1 then the area defined by the color 
found at the (x,y) coordinates will be filled, and filling stops at any color that 
differs from the starting point. 
<br>
<br>
On 32-bit images, the alpha channel is ignored when 
determining whether a pixel counts as a border pixel or not. 

 

</td></tr>
<tr><td><i>Color (可选)</i></td>
<td> 
The color to be used for filling the pixels. 如果未指定此参数，将使用与<a href="frontcolor.html">FrontColor()</a>设置的默认颜色。这种颜色可以使用<a href="rgb.html">RGB</a>或<a href="rgba.html">RGBA</a>格式。 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>
无.


</blockquote><p><b>备注</b></p><blockquote>

此命令不能与<a href="../printer/printeroutput.html">PrinterOutput()</a>同时使用。 

</blockquote><p><b>示例</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <b><font color="#3A3966">If</font></b> <font color="#3A3966">OpenWindow</font>(0, 0, 0, 300, 300, "2DDrawing Example", <font color="#924B72">#PB_Window_SystemMenu</font> | <font color="#924B72">#PB_Window_ScreenCentered</font>)
    <b><font color="#3A3966">If</font></b> <font color="#3A3966">CreateImage</font>(0, 300, 300) <b><font color="#3A3966">And</font></b> <font color="#3A3966">StartDrawing</font>(<font color="#3A3966">ImageOutput</font>(0))
<font color="#3A3966">      Box</font>(0, 0, 300, 300,<font color="#3A3966"> RGB</font>(255, 255, 255))

<font color="#3A3966">      Circle</font>(150, 150, 125 ,$00FF00)
<font color="#3A3966">      Circle</font>(150, 150, 120 ,$FF0000)
<font color="#3A3966">      LineXY</font>(30, 150, 270, 150, $FFFFFF)
<font color="#3A3966">      FillArea</font>(150, 155, -1, $0000FF) <font color="#3A3966">; Replace -1 by $00FF00, and compare the result</font>

<font color="#3A3966">      StopDrawing</font>() 
<font color="#3A3966">      ImageGadget</font>(0, 0, 0, 300, 300,<font color="#3A3966"> ImageID</font>(0))
    <b><font color="#3A3966">EndIf</font></b>
    
    <b><font color="#3A3966">Repeat</font></b>
      Event =<font color="#3A3966"> WaitWindowEvent</font>()
    <b><font color="#3A3966">Until</font></b> Event = <font color="#924B72">#PB_Event_CloseWindow</font>
  <b><font color="#3A3966">EndIf</font></b>
</font></pre>

<br>
<p><img src="../HelpPictures/fillarea.png"></p>

</blockquote><p><b>参阅</b></p><blockquote>

<a href="frontcolor.html">FrontColor()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=ellipticalgradient.html>EllipticalGradient()</a> - <a href="index.html">2DDrawing Index</a> - <a href="frontcolor.html">FrontColor()</a> -&gt;<br><br>

</body></html>